package com.lindroid.androiduilearning.expandablelistview;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.lindroid.androiduilearning.base.BaseFragment;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author Lin
 * @date 2018/4/17
 * @function ExpandableListView模块的Fragment基类
 */

public class BaseExpandableFragment extends BaseFragment {
    public List<String> groupList = new ArrayList<>();
    public List<String> childList = new ArrayList<>();

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initData();
    }

    private void initData() {
        for (int i = 1; i <= 15; i++) {
            groupList.add(new StringBuffer("小组").append(i).toString());
        }
        Random random = new Random();
        for (String s : groupList) {
            int size = random.nextInt(10) + 5;
            for (int i = 1; i <= size; i++) {
                childList.add(new StringBuffer("成员").append(i).toString());
            }
        }
    }
}
